<?php
header("Content-type: text/html; charset=utf-8");
?>
<style>
@media print{
input {display:none}
}
</style>
<table border="1px" style="font-size:14px;border-collapse:collapse;" width="750px" align="center">
	<thead style="display:table-header-group;font-weight:bold">
		<tr height="50px">
			<td colspan="4" align="center" style="font-weight:bold;font-size:25px;">MOKER员工信息</td>
		</tr>
	</thead>
	<tbody style="text-align:center;">
		<tr height="50px">
			<th>姓名</th>
			<td><?php echo $query['name'];?></td>
			<th>部门</th>
			<td><?php echo $query['department'];?></td>
		</tr>
		<tr height="50px">
			<th>职务</th>
			<td><?php echo $query['job'];?></td>
			<th>分机</th>
			<td><?php echo $query['extension'];?></td>
		</tr>
		<tr height="50px">
			<th>手机</th>
			<td><?php echo $query['mobile'];?></td>
			<th>Email</th>
			<td><?php echo $query['email'];?></td>
		</tr>
		<tr>
			<th colspan="4">主机</th>
		</tr>
		<?php if($query['host']):?>
			<?php foreach($query['host'] as $row):?>
			<tr height="100px">
				<td><?php echo $row['name']?></td>
				<td colspan="3">
				<?php 
					echo 'IP:'.$row['ip'].'<br/><br/>';
					if($row['parts']){
						foreach($row['parts'] as $r){
							echo $r['name'].':'.$r['brand'].'-'.$r['condition'].'&nbsp&nbsp&nbsp&nbsp';
						}
					}
				?>
				</td>
			</tr>
			<?php endforeach;?>
		<?php endif;?>
		<tr>
			<th colspan="4">外设</th>
		</tr>
		<tr height="100px">
			<td colspan="4">
			<?php
				if($query['device']){
					foreach($query['device'] as $r){
						echo $r['name'].':'.$r['brand'].'-'.$r['condition'].'&nbsp&nbsp&nbsp&nbsp';
					}
				}
			?>
			&nbsp;
			</td>
		</tr>
		<tr>
			<th colspan="4">书本</th>
		</tr>
		<tr height="100px">
			<td colspan="4">
				<?php
				if($query['books']){
					foreach($query['books'] as $r){
						echo '《'.$r['name'].'》&nbsp&nbsp&nbsp&nbsp';
					}
				}
			?>
			&nbsp;
			</td>
		</tr>
	</tbody>
</table>
<div style="width:200px;margin:50px auto 10px;">
	<input type=button value=" 打  印 " onclick="window.print()">
	<input type=button value=" 返  回 " onClick="history.back(-1)">
</div> 